<?php

declare(strict_types=1);

namespace app\core;


class Controller{
    private static $instance=null;

    public static function getInstance(){
        if (empty(self::$instance)) {
            self::$instance = new static();
        }

        return self::$instance;
    }

    public function init(string $controller,string $action){
        return json_encode((new $controller)->$action(),JSON_UNESCAPED_UNICODE);
    }
}